<?php
// +----------------------------------------------------------------------
// | HkCms  动态添加行为扩展到某个标签
// +----------------------------------------------------------------------
// | Copyright (c) 2012-2019 http://www.hkcms.cn, All rights reserved.
// +----------------------------------------------------------------------
// | Author: 广州恒企教育科技有限公司 <admin@hkcms.cn>
// +----------------------------------------------------------------------

use think\Hook;

if (hkcms_is_installed()) {
    $behavior = hk_cache('Behavior');
    if (!empty($behavior) && is_array($behavior)) {
        foreach ($behavior as $key=>$value) {
            if (!empty($value)) {
                foreach ($value as $k=>$v) {
                    if (!empty($v['class'])) {
                        Hook::add($v['tagname'], $v['class']);
                    }
                }
            }
        }
    }
}